﻿@model DavidCms.Web.Models.ArticlePO

@{
    ViewBag.Title = "添加文章";
    Layout = "~/Views/Shared/CmsBgLayout.cshtml";
}

<h2>添加文章</h2>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>ArticlePO</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.NavigationId)
        </div>
        <div class="editor-field">
            @Html.DropDownList("NavigationId", "请选择")
            @Html.ValidationMessageFor(model => model.NavigationId)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Editer)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Editer)
            @Html.ValidationMessageFor(model => model.Editer)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Content)
        </div>
        <div class="editor-field">
                @Html.TextAreaFor(model => model.Content)
                @Html.ValidationMessageFor(model => model.Content)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("返回文章列表", "Index", "ArticleBg", null, null);
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
@Scripts.Render("~/bundles/jqueryval", "~/Content/ueditor/ueditor.config.js", "~/Content/ueditor/ueditor.all.js")
<script type="text/javascript">
    var editorOption = {
        initialFrameWidth: 784,
        initialFrameHeight: 400
    };
    var editor = new baidu.editor.ui.Editor(editorOption);
    editor.render('Content');
    $('form').submit(function () {
        $('#Content').val(editor.getContent());
    });
</script>

}